# Required Vars:
# ${TGT_NAME}
# ${TARGET_SRC}
# ${TARGET_H}

SET(INSTALL_INCDIR include)
SET(INSTALL_BINDIR bin)
IF(WIN32)
    SET(INSTALL_LIBDIR bin)
    SET(INSTALL_ARCHIVEDIR lib)
ELSE(WIN32)
    SET(INSTALL_LIBDIR lib${LIB_POSTFIX})
    SET(INSTALL_ARCHIVEDIR lib${LIB_POSTFIX})
    SET(INSTALL_FRAMEWORKDIR Frameworks)
ENDIF(WIN32)

SET(HEADERS_GROUP "Header Files")

SOURCE_GROUP(
    ${HEADERS_GROUP}
    FILES ${TARGET_H}
)

IF(MSVC AND OSG_MSVC_VERSIONED_DLL)
   HANDLE_MSVC_DLL()
ENDIF(MSVC AND OSG_MSVC_VERSIONED_DLL)


INSTALL (
   FILES        ${TARGET_SRC} ${TARGET_H}
   DESTINATION  examples/${TGT_NAME}
   COMPONENT delta3d-examples
)

INSTALL(
  TARGETS ${TGT_NAME}
  RUNTIME DESTINATION ${INSTALL_BINDIR} COMPONENT delta3d-examples
  LIBRARY DESTINATION ${INSTALL_LIBDIR} COMPONENT delta3d-examples
  FRAMEWORK DESTINATION ${INSTALL_FRAMEWORKDIR} COMPONENT delta3d-examples
  ARCHIVE DESTINATION ${INSTALL_ARCHIVEDIR} COMPONENT delta3d-examples
)
